package com.mall.common.domain.component;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import com.mall.common.domain.BaseEntity;

/**
 * 插件桩
 */
@Entity
@Table(name = "s_component_bundle")
public class ComponentBundleDomain extends BaseEntity {

	private static final long serialVersionUID = -234516245217072863L;
	private String name;//名称
	private String bundleId;//插件桩ID
	private Set<ComponentDomain> components;//插件

	@Column(unique = true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getBundleId() {
		return bundleId;
	}

	public void setBundleId(String bundleId) {
		this.bundleId = bundleId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "componentBundle")
	@Cascade(value={CascadeType.DELETE})
	public Set<ComponentDomain> getComponents() {
		return components;
	}

	public void setComponents(Set<ComponentDomain> components) {
		this.components = components;
	}

}
